package it.test.dao;

import it.test.commons.BasePojo;
import it.test.commons.DTO;

import java.io.Serializable;
import java.util.List;

import org.springframework.dao.DataAccessException;

public interface BaseDAO<T extends BasePojo, ID extends Serializable> {

	public abstract DTO<T> find(ID id) throws DataAccessException;

	public abstract void save(DTO<T> dto) throws DataAccessException;

	public abstract void saveOrUpdate(DTO<T> dto) throws DataAccessException;
	
	public abstract void update(DTO<T> dto) throws DataAccessException;

	public abstract void delete(DTO<T> dto) throws DataAccessException;

	public abstract List<T> findAll() throws DataAccessException;

	public abstract List<T> findInRange(int firstResult, int maxResults) throws DataAccessException;
	
	public long count() throws DataAccessException;

}
